package com.ideal.manage.esms.util;

import java.util.Properties;

/**
 * 解析jdbc.properties配置文件
 * @author kit.zheng
 *
 */
public class Configure {
	
	private static Configure instance = null;
	private Properties props = null;
	
	static {
		instance = new Configure();
	}

	public static Configure getInstance() {
		return instance;
	}

	private Configure() {
		props = new Properties();
		try {
			// 加载属性文件
			props.load(Configure.class.getClassLoader()
					.getResource("application.properties").openStream());
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

	public String getProperty(String prop) {
		return props.getProperty(prop);
	}
	
	public static void main(String[] args) {
		
		System.out.println(Configure.getInstance().getProperty("dataSource.driverClassName"));
		System.out.println(Configure.getInstance().getProperty("dataSource.url"));
		System.out.println(Configure.getInstance().getProperty("dataSource.username"));
		System.out.println(Configure.getInstance().getProperty("dataSource.password"));
	}
}
